package main

import (
	"go-gin-vue/ginessential/common"
	"go-gin-vue/ginessential/controller"
	"go-gin-vue/ginessential/middleWare"

	"github.com/gin-gonic/gin"
	_ "github.com/jinzhu/gorm/dialects/postgres"
)

func main() {
	db := common.InitDB()
	defer db.Close()

	r := gin.Default()
	r.Use(middleWare.Cors()) //跨域!!!!!!!!
	r.POST("/login", controller.Login)
	r.GET("/users", controller.Set_Users)

	panic(r.Run(":1016"))
}
